//
//  PostEvaluateCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/12/10.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "PostEvaluateCell.h"

@implementation PostEvaluateCell

+(CGFloat)calculateHWithModel:(CommunityEvaModel *)model {
    return model.itemHeight;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)fillWithModel:(CommunityEvaModel *)model {
        
    if (model.evaContentAttr) {
        self.mainTitleLab.attributedText = model.evaContentAttr;
    } else {
        //富文本
        NSMutableAttributedString * attrStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@:%@",model.userNickName,model.content]];
        NSRange nameRange = NSMakeRange(0, model.userNickName.length);
        NSRange contentRange = NSMakeRange(model.userNickName.length + 1,model.content.length);
        // 设置字体大小
        [attrStr addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:12] range:nameRange];
        [attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:13] range:contentRange];
        self.mainTitleLab.attributedText = attrStr;
    }
}


@end
